package br.com.comanda.webservice.business;

import java.util.List;

import br.com.comanda.webservice.dao.ProductDAO;
import br.com.comanda.webservice.dao.impl.ProductDAOImpl;
import br.com.comanda.webservice.model.Product;
import br.com.comanda.webservice.persistence.HibernateUtil;

public class ProductBusiness {

	public List<Product> findAll() {
		ProductDAO productDAO = new ProductDAOImpl();
		productDAO.setSession(HibernateUtil.getSession());

		return productDAO.findAll();
	}

	public Product findById(Long id) {
		ProductDAO productDAO = new ProductDAOImpl();
		productDAO.setSession(HibernateUtil.getSession());

		return productDAO.findById(id);
	}

}
